package com.zfast.yugioh.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zfast.forge.valid.Create;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * 用户角色关系表
 *
 * @author zgn
 * @email 
 * @date 2022-06-11 15:07:43
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_sys_user_role")
@ApiModel(value = "UserRole", description = "用户角色关系表")
public class UserRole implements Serializable{
    private static final long serialVersionUID=1L;

    @Id
    @Column(name = "user_id")
    @ApiModelProperty("用户id")
    @NotNull(message = "用户id不可为空", groups = {Create.class})
    private Integer userId;

    @Column(name = "role_id")
    @ApiModelProperty("角色id")
    @NotNull(message = "角色id不可为空", groups = {Create.class})
    private Integer roleId;

    @Column(name = "is_core")
    @ApiModelProperty("核心0;否;1是")
    @NotNull(message = "核心0;否;1是不可为空", groups = {Create.class})
    private Boolean isCore;

    @Transient
    @ApiModelProperty("模糊查询字段")
    private String whe;
}
